# $Id: makefile,v 1.11 1998/07/20 22:49:21 ericb Exp $
# Copyright (C) 1995 - 1998, Hewlett-Packard Company, all rights reserved.
# Written by Bryan Murray

# Makefile for E1432 -> E1562 LIF throughput record and playback examples.

# Specify the base directories for the needed include files and libraries.
E1562_BASE = /opt/e1562
XPLOT_BASE = ../../demo

E1432_BASE	= /opt/e1432
E1432_TPUT	= $(E1432_BASE)/examples/throughput

CC = cc
CCOPTIONS = +O3
CFLAGS = -Ae $(CCOPTIONS) -I$(E1562_BASE)/include
LNFLAGS	= $(CFLAGS) -I$(E1432_BASE)/include -I$(XPLOT_BASE) -x
LD = $(CC)
LDOPTIONS = -s
LDFLAGS = -L$(E1432_BASE)/lib -L$(E1562_BASE)/lib -L/usr/lib/X11R5 $(LDOPTIONS)

# Specify the libraries required for each application.  Add /usr/lib/end.o
# to the beginning of the list for use with a debugger.
TP_LIBS = -l1432 -l1562fs -lsicl -lm
PB_LIBS = -l1562fs $(XPLOT_BASE)/xplot.a -lX11 -lsicl -lm
LNLIBS	= $(E1432_BASE)/lib/llib-l1432.ln $(XPLOT_BASE)/llib-lxplot.ln -lm

TARGETS = tput pbck

all: $(TARGETS)

lint:	e1562tput.c pbck.c tput.c e1562tput.h tputhdr.h
	lint $(LNFLAGS) e1562tput.c pbck.c tput.c $(LNLIBS) > lint

clean:
	rm -f *.o *~ core a.out lint $(TARGETS)

install:	all
	if [ ! -d $(E1432_TPUT) ]; then\
		mkdir $(E1432_TPUT); fi
	cp -f README makefile e1562tput.c e1562tput.h pbck.c tput.c tputhdr.h\
		$(TARGETS) $(E1432_TPUT)
	chmod -w $(E1432_TPUT)/*

e1562tput.o:	e1562tput.c e1562tput.h
	$(CC) -c $(CFLAGS) -o $@ e1562tput.c

# Throughput record application.
tput.o:	tput.c e1562tput.h tputhdr.h
	$(CC) -c $(CFLAGS) -I$(E1432_BASE)/include -o $@ tput.c

tput:	tput.o e1562tput.o
	$(LD) $(LDFLAGS) -o $@ tput.o e1562tput.o $(TP_LIBS)

# Throughput post-processing application.
pbck.o:	pbck.c e1562tput.h tputhdr.h
	$(CC) -c $(CFLAGS) -I$(E1432_BASE)/include -I$(XPLOT_BASE) -o $@ pbck.c

pbck:	pbck.o e1562tput.o
	$(LD) $(LDFLAGS) -o $@ pbck.o e1562tput.o $(PB_LIBS)
